﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace yiCommerce.Core.Domain.Orders
{
    public static class OrderStatusExtension
    {
        public static string ToDesc(this OrderStatus orderStatus)
        {
            if (orderStatus == OrderStatus.Pending)
            {
                return "pending";
            }
            else if (orderStatus == OrderStatus.Processing)
            {
                return "processing";
            }
            else if (orderStatus == OrderStatus.Complete)
            {
                return "Complete";
            }
            else if (orderStatus == OrderStatus.Cancelled)
            {
                return "Cancelled";
            }
            else
            {
                throw new Exception(string.Format("orderstatus {0} not exist", orderStatus));
            }
        }
    }
}
